package com.zhuo.project.order.service.impl;

import java.util.List;
import com.zhuo.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhuo.project.order.mapper.ZzDiagnoseOptLogMapper;
import com.zhuo.project.order.domain.ZzDiagnoseOptLog;
import com.zhuo.project.order.service.IZzDiagnoseOptLogService;

/**
 * 处方单操作历史Service业务层处理
 * 
 * @author zhuo
 * @date 2020-03-26
 */
@Service
public class ZzDiagnoseOptLogServiceImpl implements IZzDiagnoseOptLogService 
{
    @Autowired
    private ZzDiagnoseOptLogMapper zzDiagnoseOptLogMapper;

    /**
     * 查询处方单操作历史
     * 
     * @param id 处方单操作历史ID
     * @return 处方单操作历史
     */
    @Override
    public ZzDiagnoseOptLog selectZzDiagnoseOptLogById(Long id)
    {
        return zzDiagnoseOptLogMapper.selectZzDiagnoseOptLogById(id);
    }

    /**
     * 查询处方单操作历史列表
     * 
     * @param zzDiagnoseOptLog 处方单操作历史
     * @return 处方单操作历史
     */
    @Override
    public List<ZzDiagnoseOptLog> selectZzDiagnoseOptLogList(ZzDiagnoseOptLog zzDiagnoseOptLog)
    {
        return zzDiagnoseOptLogMapper.selectZzDiagnoseOptLogList(zzDiagnoseOptLog);
    }

    /**
     * 新增处方单操作历史
     * 
     * @param zzDiagnoseOptLog 处方单操作历史
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int insertZzDiagnoseOptLog(ZzDiagnoseOptLog zzDiagnoseOptLog)
    {
        zzDiagnoseOptLog.setCreateTime(DateUtils.getNowDate());
        return zzDiagnoseOptLogMapper.insertZzDiagnoseOptLog(zzDiagnoseOptLog);
    }

    /**
     * 修改处方单操作历史
     * 
     * @param zzDiagnoseOptLog 处方单操作历史
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateZzDiagnoseOptLog(ZzDiagnoseOptLog zzDiagnoseOptLog)
    {
        zzDiagnoseOptLog.setUpdateTime(DateUtils.getNowDate());
        return zzDiagnoseOptLogMapper.updateZzDiagnoseOptLog(zzDiagnoseOptLog);
    }

    /**
     * 批量删除处方单操作历史
     * 
     * @param ids 需要删除的处方单操作历史ID
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteZzDiagnoseOptLogByIds(Long[] ids)
    {
        return zzDiagnoseOptLogMapper.deleteZzDiagnoseOptLogByIds(ids);
    }

    /**
     * 删除处方单操作历史信息
     * 
     * @param id 处方单操作历史ID
     * @return 结果
     */
    @Override
    @Transactional(rollbackFor = Exception.class)
    public int deleteZzDiagnoseOptLogById(Long id)
    {
        return zzDiagnoseOptLogMapper.deleteZzDiagnoseOptLogById(id);
    }
}
